<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html class="win-frame">
<head>
<title>${name_china}管理-新建${name_china}</title>
 <%@include file="/common/head.jsp" %>

</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
            <span class="split"></span>
            <span>新建${name_china}</span>
        </div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>

<form id="addForm" method="post">
  <div id="left" style="width:80%;float:left">
	 <div class="form-wrapper">
		<div class="h4 distance-double">
	        <span class="h4-title"><i class="icon icon-setting"></i>基本信息</span>
	        <span class="h4-border"></span>
	    </div>
	    
	     <div class="form-cont">
	        <p class="form-cont-title">排序号</p>
	        <input type="text" id="reorder" name="reorder" class="summer-input summer-validatebox"  data-validatebox="validType:['noNegativeNumber']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>用户名</p>
	        <input type="text" id="userNickName" name="userNickName" class="summer-input summer-validatebox"  data-validatebox="validType:['required','maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>用户ID</p>
	        <input type="text" id="userId" name="userId" class="summer-input summer-validatebox"  data-validatebox="validType:['required','maxLength[50]']"/> 
	     </div> 
	     
	      <div class="form-cont">
	        <p class="form-cont-title">手机号</p>
	        <input type="text" id="userPhone" name="userPhone" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[11]']"/> 
	     </div>
	     
	      <div class="form-cont">
	        <p class="form-cont-title">微信号</p>
	        <input type="text" id="unionid" name="unionid" class="summer-input"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">用户头像</p>
	        <input type="text" id="userHeadImg" name="userHeadImg" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[500]']"/> 
	     </div>
	 
	    <div class="form-cont">
	        <p class="form-cont-title">店主的邀请码</p>
	        <input type="text" id="invitingCode" name="invitingCode" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[100]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">可用余额</p>
	        <input type="text" id="money" name="money" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">邀请人ID</p>
	        <input type="text" id="parentId" name="parentId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[500]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">预计收益</p>
	        <input type="text" id="preProfit" name="preProfit" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">成功邀请到店主的人数(下级)</p>
	        <input type="text" id="successPeopleOne" name="successPeopleOne" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">积分</p>
	        <input type="text" id="jifeng" name="jifeng" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">来源</p>
	        <input type="text" id="laiyuan" name="laiyuan" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">微信公众号OPENID</p>
	        <input type="text" id="openid" name="openid" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">总收益</p>
	        <input type="text" id="totalProfit" name="totalProfit" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">云店主ID(返佣金收益的店主ID)</p>
	        <input type="text" id="yunId" name="yunId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	    
	     <div class="form-cont">
	        <p class="form-cont-title">是否为黑名单</p>
	        <input type="text" id="isBlack" name="isBlack" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">用户密码</p>
	        <input type="text" id="userPwd" name="userPwd" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否为云店主</p>
	        <input type="text" id="type" name="type" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">VIP用户等级</p>
	        <input type="text" id="vipLevel" name="vipLevel" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">云用户等级</p>
	        <input type="text" id="yunLevel" name="yunLevel" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">活跃状态</p>
	        <input type="text" id="isActive" name="isActive" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">成功邀请到下级的下级人数</p>
	        <input type="text" id="successPeopleTwo" name="successPeopleTwo" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">性别</p>
	        <input type="text" id="sex" name="sex" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">城市</p>
	        <input type="text" id="city" name="city" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">生日</p>
	        <input type="text" id="birth" name="birth" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">用户在平台中的总消费金额</p>
	        <input type="text" id="totalComsum" name="totalComsum" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[10]']"/> 
	     </div>
	 <div class="form-btn-wrapper" id="funcbar">
        <a class="btn btn-normal" id="backBtn">关闭</a>
    </div>
  </div>
  </div>
	
</form>
<script>
    var  permission = CommonUtil.getPermission('${name_english}');
    $(function () {
    	//初始化下拉选项
   	 
	$('#isBlack').combobox({
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_USERS_MALL_IS_BLACK'
		});

		$('#vipLevel').combobox({
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_USERS_MALL_VIP_LEVEL'
		});
		
		$('#sex').combobox({
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_USERS_MALL_SEX'
		});
		
		$('#type').combobox({
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_USERS_MALL_TYPE'
		});

		//初始化funcbar
		$('#funcbar').prepend($.funcbar({
			type : 'button',
			data : permission,
			permit : [ '${name_english}:add' ]
		}));

		//保存按钮
		$('#funcbar').on('click', 'a[data-permit="${name_english}:add"]', {
			isContinue : false
		}, submit);

		//返回按钮
		$('#backBtn,#goBack').on('click', backMain);

	});

	//表单提交
	function submit(event) {
		$("#addForm").form({
			buttons : [ '#saveBtn', '#saveBtnContinue' ],
			ajax : {
				url : CONST_URL.ADD
			},
			onSubmitSuccess : function(data) {
				$.stip({
					type : 'ok',//显示类型 有info、 ok、 danger
					text : '保存成功！',
					onBeforeHide : function() {
						var isContinue = event.data.isContinue;
						if (isContinue) {
							resetForm();
						} else {
							backMain();
						}
					}
				});
			}
		}).form("submit");
	}

	//保存并继续清空form
	function resetForm() {
		//$('#xm,#zw,#cs,#bgdh,#sjhm').val('');
	}

	//返回主页面
	function backMain() {
		window.location.href = CONST_URL.INIT_MAIN;
	}

	//请求url
	var CONST_URL = {
		INIT_MAIN : basePath + "${common_url}init",
		ADD : basePath + "${common_url}add"
	};
</script>
</body>
</html>